<?php

// +----------------------------------------------------------------------
// | 属性值数据表
// +----------------------------------------------------------------------

namespace common\model;

use think\model\RelationModel;

class AttributeValueModel extends RelationModel
{

    //自动验证
    protected $_validate = [
        ['attribute_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['value', '1,64', '', self::EXISTS_VALIDATE, 'length'],
        ['variable', '0,8', '', self::EXISTS_VALIDATE, 'length'],
        ['attribute_id,value', '', '', self::MUST_VALIDATE, 'unique'], // 联合唯一
    ];

    //自动完成
    protected $_auto = [
        ['uuid', 'create_uuid', self::MODEL_INSERT, 'function']
    ];

}
